import request from '@/utils/request'

// 查询物料需求单列表
export function listNeed(query) {
  return request({
    url: '/system/need/list',
    method: 'get',
    params: query
  })
}

// 查询物料需求单详细
export function getNeed(id) {
  return request({
    url: '/system/need/' + id,
    method: 'get'
  })
}

// 新增物料需求单
export function addNeed(data) {
  return request({
    url: '/system/need',
    method: 'post',
    data: data
  })
}

// 修改物料需求单
export function updateNeed(data) {
  return request({
    url: '/system/need',
    method: 'put',
    data: data
  })
}

// 删除物料需求单
export function delNeed(id) {
  return request({
    url: '/system/need/' + id,
    method: 'delete'
  })
}

export function getAllMat(matPlan) {
  return request({
    url: '/system/plan/select/all/mat',
    method: 'get',
    params: { matPlan }
  })
}
